package com.zpark.controller;

import com.zpark.feign.DeptControllerFeign;
import com.zpark.pojo.Dept;
import com.zpark.utils.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: FeignController
 * @Description:
 * @author: RZS
 * @date: 2024/5/7  16:35
 */
@RestController
public class FeignController {

    @Autowired
    private DeptControllerFeign deptControllerFeign;

    @GetMapping("/{id}")
    public ResponseData<Dept> findId(@PathVariable Integer id){
        return deptControllerFeign.findById(id);
    }


    @GetMapping("/all")
    public ResponseData<List<Dept>> all(){
        return deptControllerFeign.findAll();
    }
}
